<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <body class="body_cls">
        <ui:composition template="/resources/templates/estudiantes_master_template.xhtml">
            <ui:define name="title">
                SysADS - Registro Datos Estudiantes
            </ui:define>

            <ui:define name="content">
                <h:form>

                    <p:panel id="rg_pnl">
                        <p:focus context="rg_pnl"/>
                        <h:form id="form">

                            <p:growl id="msgs" showDetail="true" life="5000"  />

                            <p:panel header="Inscripción" style="margin-bottom:10px;">
                                <h:panelGrid columns="2" cellpadding="5">
                                    <h:outputLabel for="city" value="Seleccionar Curso/Carrera: " />
                                    <p:selectOneMenu id="city" value="#{pPRBean.city}" required="true">
                                        <f:selectItem itemLabel="Cursos" itemValue="" />
                                        <f:selectItems value="#{pPRBean.cities}" />
                                        <p:ajax update="suburbs" listener="#{pPRBean.handleCityChange}" />
                                    </p:selectOneMenu>

                                    <h:outputLabel for="city" value="Seleccionar Modulo: " />
                                    <p:selectOneMenu id="suburbs" value="#{pPRBean.suburb}" required="true">
                                        <f:selectItem itemLabel="Modulos" itemValue="" />
                                        <f:selectItems value="#{pPRBean.suburbs}" />
                                    </p:selectOneMenu>
                                </h:panelGrid>
                                <p:panel header="Secciones Disponibles" >
                                    <h:panelGrid columns="1">
                                        <!--                                        <p:selectBooleanCheckbox value="" itemLabel="Secciones seleccionadas de la base de datos" />-->
                                        <p:dataTable id="basic" var="sec" value="#{pPRBean.secs}">
                                            <p:column id="modelHeader">
                                                <f:facet name="header">
                                                    Codigo Seccion
                                                </f:facet>
                                                <h:outputText value="#{sec.codigo}" />
                                            </p:column>

                                            <p:column>
                                                <f:facet name="header">
                                                    Horario
                                                </f:facet>
                                                <h:outputText value="#{sec.horario}" />
                                            </p:column>

                                            <p:column>
                                                <f:facet name="header">
                                                    Aula
                                                </f:facet>
                                                <h:outputText value="#{sec.aula}" />
                                            </p:column>

                                            <p:column>
                                                <f:facet name="header">
                                                    Profesor
                                                </f:facet>
                                                <h:outputText value="#{sec.profesor}" />
                                            </p:column>
                                            <p:column>
                                                <f:facet name="header">
                                                    Campus
                                                </f:facet>
                                                <h:outputText value="#{sec.campus}" />
                                            </p:column>
                                            <p:column>
                                                <f:facet name="header">
                                                    Seleccionar
                                                </f:facet>
                                                <p:selectBooleanButton onLabel="Yes" offLabel="No" onIcon="ui-icon-check" offIcon="ui-icon-close" />
                                            </p:column>
                                        </p:dataTable>
                                    </h:panelGrid>                                   
                                </p:panel>
                            </p:panel>
                            <p:separator />
                            <p:commandButton value="Submit" update="msgs" actionListener="#{pPRBean.displayLocation}" id="btnSubmit"/>
                        </h:form>
                        <p:spacer height="10" />
                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>
